﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using System.Text;
using Slex;

namespace Test.Scenes {
    public partial class Rtb : Page {
        public Rtb() {
            InitializeComponent();
        }

        // 当用户导航到此页面时执行。
        protected override void OnNavigatedTo(NavigationEventArgs e) {
        }

        private void LayoutRoot_Loaded(object sender, RoutedEventArgs e) {
            var sb = new StringBuilder();
            sb.StartTag("Paragraph", true);
            sb.SetText("hello world", 20, Brushs.Black);
            sb.SetText("hello world", 18, Brushs.Red,FontWeights.Bold,false);
            sb.SetText("hello world", 16, Brushs.Green);
            sb.SetLink("hello qq", "http://www.csdn.com");
            //sb.SetText("hello world", 18, Brushs.Blue,Slex.Rtb.Bold);
            //sb.SetText("hello world", 16, Brushs.Yellow,Slex.Rtb.Hyperlink);
            //sb.SetText("hello world", 14, Brushs.Red, Slex.Rtb.Inline);
            //sb.SetText("hello world", 12, Brushs.Green, Slex.Rtb.Italic);
            //sb.SetText("hello world", 10, Brushs.Purple, Slex.Rtb.Span);
            //sb.SetText("hello world", 8, Brushs.Indigo, Slex.Rtb.Underline);
            sb.EndTag("Paragraph");
            LayoutRoot.Blocks.Add(sb.ToXamlType<Paragraph>());
        }

    }
}
